package com.baikeyang.common.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import javax.persistence.Transient;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author BaiKeyang
 * @since 2019-05-19
 */
@TableName("t_file_info")
public class FileInfo extends Model<FileInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String id;

    /**
     * 文件名
     */
    private String fileName;

    /**
     * 文件大小
     */
    @Transient
    private Long size;

    /**
     * 文件类型
     */
    private String type;

    /**
     * MP3或者MP4时长
     */
    private Long mediaTime;

    /**
     * 上传时间
     */
    private Date uploadTime;

    /**
     * 文件绝对路径
     */
    private String path;

    /**
     * 文件唯一指纹
     */
    private String fileMd5;

    /**
     * 项目中的路径
     */
    private String url;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getMediaTime() {
        return mediaTime;
    }

    public void setMediaTime(Long mediaTime) {
        this.mediaTime = mediaTime;
    }

    public Date getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getFileMd5() {
        return fileMd5;
    }

    public void setFileMd5(String fileMd5) {
        this.fileMd5 = fileMd5;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }

    @Override
    public String toString() {
        return "fileInfo{" +
        "id=" + id +
        ", fileName=" + fileName +
        ", size=" + size +
        ", type=" + type +
        ", mediaTime=" + mediaTime +
        ", uploadTime=" + uploadTime +
        ", path=" + path +
        ", fileMd5=" + fileMd5 +
        ", url=" + url +
        "}";
    }
}
